Skip to content

feat(builders): add ConsistentPartitionWindowRel builder#158

Merged
bvolpato merged 1 commit intosubstrait-io:mainfrom
bvolpato:bv/consistent-partition-window-builder
May 5, 2026
Merged

feat(builders): add ConsistentPartitionWindowRel builder#158
bvolpato merged 1 commit intosubstrait-io:mainfrom
bvolpato:bv/consistent-partition-window-builder

Conversation

@bvolpato
Copy link
Copy Markdown
Member

@bvolpato bvolpato commented Mar 16, 2026

Add builder, type inference, display, and comprehensive tests for
ConsistentPartitionWindowRel, enabling window function plans with
shared partitioning and ordering.

This closes a gap between the Java and Python implementations of
the Substrait spec, adding support for the most common SQL window
function pattern — multiple window functions sharing PARTITION BY
and ORDER BY.

Changes:

  • builders/plan.py: add consistent_partition_window() builder
  • type_inference.py: add window case to infer_rel_schema()
  • utils/display.py: add _stream_window_rel() to PlanPrinter
  • tests: 8 test cases mirroring Java ConsistentPartitionWindowRelRoundtripTest

Testing:

python -m pytest tests/builders/plan/test_consistent_partition_window.py -v
# 8 passed

python -m pytest tests/ --ignore=tests/sql --ignore=tests/dataframe -q
# 220 passed

@CLAassistant

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@bvolpato bvolpato changed the title feat: add ConsistentPartitionWindowRel builder feat(builders): add ConsistentPartitionWindowRel builder Mar 16, 2026
@bvolpato bvolpato force-pushed the bv/consistent-partition-window-builder branch from 6acad0e to 2ccd15c Compare March 16, 2026 13:29
Add builder, type inference, display, and comprehensive tests for
ConsistentPartitionWindowRel, enabling window function plans with
shared partitioning and ordering.
@bvolpato bvolpato force-pushed the bv/consistent-partition-window-builder branch from 2ccd15c to 4157f6f Compare March 16, 2026 13:30
@bvolpato
Copy link
Copy Markdown
Member Author

bvolpato commented May 5, 2026

[review-prs-verification]
Head: 4157f6f
Ready to merge: yes

Files reviewed.

  • src/substrait/builders/plan.py
  • src/substrait/type_inference.py
  • src/substrait/utils/display.py
  • tests/builders/plan/test_consistent_partition_window.py

Tests/checks run and results.

  • ./check_substrait_package_versions.sh: pass
  • uv run --with ruff ruff check . (pixi unavailable locally): pass
  • uv run --with ruff ruff format --check . (pixi unavailable locally): pass
  • uv run --frozen pytest: pass (248 passed, 3 xfailed)
  • uv run --frozen examples/builder_example.py: pass
  • uv run --frozen examples/duckdb_example.py: pass
  • uv run --frozen examples/adbc_example.py: pass
  • uv run --frozen examples/pyarrow_example.py: pass
  • uv run --with build python -m build: pass

Fixes committed/pushed, if any.

  • None.

Final CI status.

  • gh pr checks 158 --watch: all listed checks passing (including tests matrix, lint/format, examples, version checks, CLA).

@bvolpato bvolpato enabled auto-merge (squash) May 5, 2026 10:09
@bvolpato bvolpato merged commit 23d4274 into substrait-io:main May 5, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants